<template>
  <div>
    <div class="memory-container">
      <template>
        <el-carousel :interval="4000" type="card" height="500px">
          <el-carousel-item v-for="(item, index) in memoryList" :key="index">
            <el-card class="box-card">
              <div slot="header" class="clearfix">
                <h4>
                  <li class="el-icon-video-play" style="margin-right: 5px"></li>
                  From{{ item.fileType }}
                </h4>
                <h4>
                  <li class="el-icon-date" style="margin-right: 5px"></li>
                  日期：{{ item.start }}
                </h4>
              </div>
              <div class="memery-content">
                <div class="memory-content-item">
                  <p>{{ item.content1 }}</p>
                </div>
                <div class="memory-content-item">
                  <p>{{ item.content2 }}</p>
                </div>
              </div>
            </el-card>
          </el-carousel-item>
        </el-carousel>
      </template>
    </div>
  </div>
</template>
    </div>
  </div>
</template>

<script>
import { getFileMemoryByStudentId } from "@/api";
export default {
  data() {
    return {
      memoryList: [
        {
          fileType: "打发打发档案",
          start: "2022-05-7-07",
          content1:
            "算法啊打发十分的是打发打发落空发送啊手动阀示范点手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
          content2: "算法啊打发十手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
        },
        {
          fileType: "打发打发档案",
          start: "2022-05-7-07",
          content1:
            "算法啊打发十分的是打发打啊手动阀示范点手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
          content2:
            "算法啊打发十分的是打发打发落空发送啊手动阀示范点手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
        },
        {
          fileType: "打发打发档案",
          start: "2022-05-7-07",
          content1:
            "算法啊打发十分的是打发打发落空发送啊手动阀示范点手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
          content2:
            "算法啊打发十分的是打发手动阀示范点手动阀手动阀是打发打发啊打发法阿斯蒂芬奥",
        },
      ],
    };
  },
  created() {
    this.getFileMemory();
  },
  methods: {
    async getFileMemory() {
      let res = await getFileMemoryByStudentId(
        this.$store.state.user.userInfo.id
      );
      if (res.code == 0) {
        this.memoryList = res.data;
      } else {
        this.$message.error(res.msg);
      }
    },
  },
};
</script>

<style lang="less" scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  //   background-color: #99a9bf;
  background-color: #dcdfe6;
  border-radius: 5px;
}

.el-carousel__item:nth-child(2n + 1) {
  //   background-color: #d3dce6;
  border-radius: 5px;
  background-color: #dcdfe6;
}

.memory-container {
  width: 90%;
  margin: auto;
  margin-top: 70px;
}
// .my-content{
//     background: burlywood;
//     width: 90%;
//     margin: auto;
//     height: 70%;
//     .my-content-item{
//         background: blue;
//     }
// }

//card
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
.clearfix {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.box-card {
  width: 99%;
  height: 99%;
  margin: auto;
  margin-top: 2px;
}

.memery-content {
  display: flex;
  flex-direction: column;
  .memory-content-item {
    margin-top: 10px;
  }
}
</style>